<div class="card border-info m-3">
    <h5 class="card-header bg-info text-white">新增</h5>
    <div class="card-body">
        <h5 class="card-title">基础信息</h5>
        <p class="card-text">请按内容提示，录入相关信息。</p>
        <div class="row mb-3">
            <div class="col-6">
                <ng-select [items]="extend.domain.gooBaseGoods.items"
                           bindLabel="name" bindValue="id"
                           [searchable]="true" [multiple]="false" [closeOnSelect]="true"
                           placeholder="{{extend.domain.gooBaseGoods.nickname}}"
                           tooltip="{{extend.domain.gooBaseGoods.nickname}}"
                           [(ngModel)]="domain.upper"
                           (change)="extend.domain.gooBaseGoods.change($event)">
                </ng-select>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">编号</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serNum">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serNum'] !== null">{{errRes.error?.detail['DraIntegralLottery.serNum']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">备注</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serMemo">
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">商品名称</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawPname">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawPname'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawPname']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">抽奖活动名称</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawName">
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">商品总价值</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawPrice">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawPrice'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawPrice']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">刷新号码所需积分</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawRefurbish">
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawRefurbish'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawRefurbish']}}</span>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">单次抽奖所需积分</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawJiFen">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawJiFen'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawJiFen']}}</span>
            </div>
            <!--下拉框-->
            <div class="col-6">
                <ng-select [dropdownPosition]="'top'"
                           [searchable]="true" bindLabel="name" bindValue="id"
                           placeholder="抽奖类型" tooltip="抽奖类型"
                           [items]="[{id:'QIANRENTUAN',name:'千人团'},{id:'BAIRENTUAN',name:'百人团'},{id:'SHIRENTUAN',name:'十人团'}]"
                           [(ngModel)]="domain.serGoodsDrawPeople">
                </ng-select>
            </div>

        </div>

        <div class="row mb-3">
            <!--下拉框-->
            <div class="col-6">
                <!--<ng-select [dropdownPosition]="'top'"
                           [searchable]="true" bindLabel="name" bindValue="id"
                           placeholder="品牌选择" tooltip="选择品牌"
                           [items]="[{id:'uuid',name:'品牌1'},{id:'uuid2',name:'品牌2'},{id:'uuid3',name:'品牌3'}]"
                           [(ngModel)]="domain.serGoodsDrawBrand">
                </ng-select>-->
                <ng-select
                        [items]="extend.domain.serGooBrand.items"
                        [multiple]="false"
                        [closeOnSelect]="true"
                        [searchable]="true"
                        bindLabel="name" bindValue="id"
                        placeholder="{{extend.domain.serGooBrand.nickname}}" tooltip="{{extend.domain.serGooBrand.nickname}}"
                        [(ngModel)]="domain.serGoodsDrawBrand"
                        (change)="extend.domain.serGooBrand.change($event)">
                </ng-select>
            </div>
            <!--时间控制器-->
            <div class="col-6">
                <app-input-data-time [field]="extend.domain.serGoodsDrawStartDate"></app-input-data-time>
           </div>
        </div>
        <div class="row mb-3">
            <!--时间控制器-->
            <div class="col-6">
                <app-input-data-time [field]="extend.domain.serGoodsDrawEndDate"></app-input-data-time>
          </div>
            <!--时间控制器-->
            <div class="col-6">
                <app-input-data-time [field]="extend.domain.serGoodsDrawOpenDate"></app-input-data-time>
          </div>
        </div>
<!--        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">审核状态</button>
                    </div>
                    <input type="text" class="form-control border-info" [readonly]="true"
                           [value]="extend.domain.serAudit()">
                    <input type="hidden" class="form-control border-info" [readonly]="true"
                           [(ngModel)]="domain.serAudit">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serAudit'] !== null">{{errRes.error?.detail['DraIntegralLottery.serAudit']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">启用状态</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button btnCheckbox btnCheckboxTrue="ENABLE" btnCheckboxFalse="DISABLE"
                                (click)="domain.serUsing = domain.serUsing === 'DISABLE' ? 'ENABLE' : 'DISABLE'"
                                class="btn border-info w-100" type="button"
                                [ngClass]="{'btn-primary': domain.serUsing === 'ENABLE', 'disabled btn-secondary': domain.serUsing === 'DISABLE'}">
                            {{domain.serUsing === 'DISABLE' ? '禁用' : '启用'}}
                        </button>
                    </div>
                </div>
            </div>
        </div>-->
        <div class="row mb-3">
            <!--单图上传-->
             <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawP2 !== null && domain.serGoodsDrawP2 !== undefined && domain.serGoodsDrawP2.length > 0">
                        <img [src]="domain.serGoodsDrawP2" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP2}}</span></p>
                    </div>
                    <input #file class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawP2.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawP2.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">宫格/搜索图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawP2'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawP2']}}</span>
            </div>
            <!--单图上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawP3 !== null && domain.serGoodsDrawP3 !== undefined && domain.serGoodsDrawP3.length > 0">
                        <img [src]="domain.serGoodsDrawP3" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP3}}</span></p>
                    </div>
                    <input #file1 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawP3.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawP3.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">长图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file1.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawP3'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawP3']}}</span>
            </div>
        </div>
        <div class="row mb-3">
            <!--单图上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawP4 !== null && domain.serGoodsDrawP4 !== undefined && domain.serGoodsDrawP4.length > 0">
                        <img [src]="domain.serGoodsDrawP4" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP4}}</span></p>
                    </div>
                    <input #file2 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawP4.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawP4.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">瀑布流图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file2.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawP4'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawP4']}}</span>
            </div>
        </div>
        <div class="row mb-3">
            <!--多图上传-->
<!--
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">商品轮播图</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawP1">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawP1'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawP1']}}</span>
            </div>
-->
            <div class="col-6">
<!--
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2"
                         *ngIf="domain.serGoodsDrawP1 !== null && domain.serGoodsDrawP1 !== undefined && domain.serGoodsDrawP1.length > 0">
                        <img [src]="domain.serGoodsDrawP1" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP1}}</span></p>
                    </div>
                    <input #file3 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.files.oss.uploader"
                           (change)="extend.domain.files.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">轮播图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file3.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawP1'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawP1']}}</span>
-->                <ng-container aria-label="ossUpload">
                <ng-container *ngFor="let file of extend.domain.files.fileUrls">
                    <div class="mb-2" style="border: 1px solid cadetblue; overflow: auto;">
                        <img [src]="file" style="height: 15rem;">
                        <p><span class="badge badge-success">{{file}}</span></p>
                        <button type="button" class="btn btn-sm btn-danger"
                                (click)="extend.domain.files.del.click($event, file)">Del
                        </button>
                    </div>
                </ng-container>
                <input #file3 class="displayNone" type="file" ng2FileSelect
                       [uploader]="extend.domain.files.oss.uploader"
                       (change)="extend.domain.files.change($event)"/>
            </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">轮播图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file3.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawP1'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawP1']}}</span>
            </div>
            <!--视频上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2"
                         *ngIf="domain.serGoodsDrawView !== null && domain.serGoodsDrawView !== undefined && domain.serGoodsDrawView.length > 0">
                        <video [src]="domain.serGoodsDrawView" style="height: 15rem;"></video>
                        <p><span class="badge badge-success">{{domain.serGoodsDrawView}}</span></p>
                    </div>
                    <input #file4 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawView.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawView.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">视频</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file4.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraIntegralLottery.serGoodsDrawView'] !== null">{{errRes.error?.detail['DraIntegralLottery.serGoodsDrawView']}}</span>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-12">
                <h4>商品描述</h4>
                <div [froalaEditor]='froalaEditorOptions' [(froalaModel)]="domain.serGoodsDrawDesc">Hello, Froala!</div>
            </div>
        </div>

        <!--
                <div class="row mb-3">
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend w-25">
                                <button class="btn btn-info border-info w-100" type="button">serValid</button>
                            </div>
                            <input type="text" class="form-control border-info" [value]="'serValid'">
                        </div>
                        <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serValid'] !== null">{{errRes.error?.detail['DraIntegralLottery.serValid']}}</span>
                    </div>
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend w-25">
                                <button class="btn btn-info border-info w-100" type="button">serValid2</button>
                            </div>
                            <input type="text" class="form-control border-info" [value]="'serValid2'">
                        </div>
                        <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraIntegralLottery.serValid2'] !== null">{{errRes.error?.detail['DraIntegralLottery.serValid2']}}</span>
                    </div>
                </div>
        -->
        <div class="text-center mt-5">
            <button type="button" class="btn btn-outline-primary" (click)="func.save.req($event)">Save</button>
        </div>
    </div>
</div>

<span class="badge badge-info mr-3" *ngIf="errRes?.error?.timestamp !== null">response time: {{errRes?.error?.timestamp}}</span>
<div *ngIf="false">
    <p>{{errRes.error}}</p>
    <p>{{errRes.error?.code}}</p>
    <p>{{errRes.error?.description}}</p>
    <p>{{errRes.error?.theme}}</p>
    <p>{{errRes.error?.timestamp}}</p>
    <p>{{errRes.error?.detail?.RR?.duration}}</p>
    <p>{{errRes.error?.detail['DraIntegralLottery.serNum']}}</p>
    <p>{{errRes.error?.detail['DraIntegralLottery.serAudit']}}</p>
    <p>{{errRes.error?.detail['DraIntegralLottery.serValid']}}</p>
    <p>{{errRes.error?.detail['DraIntegralLottery.serValid2']}}</p>
    <p>{{errRes.headers}}</p>
    <p>{{errRes.message}}</p>
    <p>{{errRes.name}}</p>
    <p>{{errRes.ok}}</p>
    <p>{{errRes.status}}</p>
    <p>{{errRes.statusText}}</p>
    <p>{{errRes.url}}</p>
</div>
